<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/5/6
  Time: 19:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form id="upd_from_to" action="/allUser_add" method="post">
    用户名:<input id="uname" name="uname" type="text"  ><br>
    密码:<input id="pwd" name="pwd" type="password"><br>
    重复密码:<input id="repwd" name="repwd" type="password"><br>
    <input type="submit" value="确定">
</form>
<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/lib/jquery.js"></script>
<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/jquery.validate.min.js"></script>
<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/localization/messages_zh.js"></script>
<script type="text/javascript">
    $("#upd_from_to").validate({
        rules:{
            uname:{
                required:true,
            },
            pwd:{
                required:true,
                minlength:3
            },
             repwd:{
                required:true,
                equalTo:"#pwd",
                minlength:3
            },
        },
        messages: {
            uname: {
                required: "请输入用户名",
            },
            pwd: {
                required: "请输入密码",
                minlength: "密码长度不能小于 5 个字母"
            },
            repwd: {
                required: "请输入密码",
                minlength: "密码长度不能小于 5 个字母",
                equalTo: "两次密码输入不一致"
            },

        },
        onkeyup:false,
        focusCleanup:true,
        onsubmit:true,
        submitHandler:function(form){
            form.submit();
        }

    })

</script>

</body>
</html>
